home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Garbo
/
Garbo.cdr
/
mac
/
source
/
music4c.sit
/
Music4C Folder
/
Sources Folder
/
About_Dialog_Box.c
next >
Wrap
Text File
|
1990-06-08
|
3KB
|
133 lines
/*
* ⌐ Graeme Gerrard 1990
* Faculty of Music, University of Melbourne
* Parkville Victoria 3052 Australia.
*
* ARPANET: grae@murdu.ucs.unimelb.edu.au
* telephone: (613) 344 4127, Fax: (613) 344 5346
*/
#include "About_Dialog_Box.h"
static pascal char MyFilter (DialogPtr theDialog, EventRecord *theEvent, short *itemHit);
static void Refresh_Dialog(DialogPtr GetSelection);
#define TRUE 1
#define FALSE 0
#define NIL 0
#define I_Picture2 1
#define I_Rectangle1 2
static char ExitDialog;
static char DoubleClick;
static Point myPt;
/* ********************************************* */
static pascal char MyFilter (theDialog, theEvent, itemHit)
DialogPtr theDialog;
EventRecord *theEvent;
short *itemHit;
{
Rect tempRect;
char xMyFilter;
xMyFilter = FALSE;
if (theEvent->what == mouseDown)
{
myPt = theEvent->where;
GlobalToLocal(&myPt);
}
return(xMyFilter);
}
/* ======================================================== */
/* ======================================================== */
/* This is an update routine for non-controls in the dialog */
/* This is executed after the dialog is uncovered by an alert */
static void Refresh_Dialog(GetSelection)
DialogPtr GetSelection;
{
Rect tempRect;
short DType;
Handle DItem;
ControlHandle CItem;
/* Draw a rectangle, Rectangle1 */
SetRect(&tempRect, 1,1,308,260);
FrameRect(&tempRect);
}
/* ======================================================== */
void D_About_Dialog_Box()
{
DialogPtr GetSelection;
Rect tempRect;
short DType;
short Index;
Handle DItem;
ControlHandle CItem, CTempItem;
Str255 sTemp;
short itemHit;
short temp;
Handle Icon_Handle;
Point NewMouse;
char InIcon;
TEHandle ThisEditText;
DialogPeek TheDialogPtr;
GetSelection = GetNewDialog(2, NIL, (WindowPtr)-1);
tempRect.top = GetSelection->portRect.top;
tempRect.left = GetSelection->portRect.left;
tempRect.bottom = GetSelection->portRect.bottom;
tempRect.right = GetSelection->portRect.right;
tempRect.top = ((screenBits.bounds.bottom - screenBits.bounds.top) - (tempRect.bottom - tempRect.top)) / 2;
tempRect.left = ((screenBits.bounds.right - screenBits.bounds.left) - (tempRect.right - tempRect.left)) / 2;
MoveWindow(GetSelection, tempRect.left, tempRect.top, TRUE);
ShowWindow(GetSelection);
SelectWindow(GetSelection);
SetPort(GetSelection);
/* Setup initial conditions */
Refresh_Dialog(GetSelection);
ExitDialog = FALSE;
do
{
ModalDialog(NIL, &itemHit);
GetDItem(GetSelection, itemHit, &DType, &DItem, &tempRect);
CItem = (ControlHandle)DItem;
/* Handle it real time */
if (itemHit == I_Picture2 )
{
/* ?? Code to handle this picture goes here */
}
/* ?? ******** */
ExitDialog = TRUE;
/* ?? ******** */
}
while (ExitDialog == FALSE);
/* Get results after dialog */
DisposDialog(GetSelection);
}